package ch.zbw.iCoach.withArrays;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;

import ch.zbw.iCoach.remo.User;

public class LanguageList {
	
    private static ArrayList <Language> languageList;
    
    public LanguageList (){
    	
    	this.languageList = new ArrayList<Language>();
    }
         
    public void createLanguage (Language language)
    {
        this.languageList.add(language);
    }
    
    public boolean addLanguage (Language lang){
		return this.languageList.add(lang);
		
	}
	
	public void deleteLanguage (int index){
		
		this.languageList.remove(index);
	}
	
	//You can select an user by a index.
	//this method need an index which is used to locate the User
	//in the arraylist
	public Language getlang(int index){
		int tempindex = index; 
		System.out.println("Array size: " + this.languageList.size());
		System.out.println("indey: " + index);
		return this.languageList.get(index);
	}
	
	//gives you an int value back. The value is the size
	//of the Array
	public int getSize(){
		return this.languageList.size();
	}
	
	public void clearAllData()
	{
		languageList.clear();
	}
	public void printLang()
	{
		for( int i = 0; i< languageList.size(); i++)
			System.out.println( Arrays.asList(languageList));
	}

}


